const { resolve } = require('path')
const express = require('express')
const app = express()

//localhost:5001相当于就直接走到了public文件夹里面
app.use(express.static('public')) //处理静态资源的中间件
app.get('/abc/efg/xxx', function (req, res) {
  res.sendFile(resolve(__dirname, 'public', 'index.html'))
})

app.listen(5001, (err) => {
  if (err) console.log('fail')
  else console.log('ok')
})
